/**
  * setup
  */
var assert = require('assert');


exports.setUp = function(){
  console.log("setup");
  console.log("------------------------");
}

exports.testUserCreate = function(beforeExit)
{
  var nohm = require('nohm').Nohm;
  var User = require('../models/User.js');
  this.redis = require('redis');
  this.cli = redis.createClient();
  console.log("running test...");
  
  nohm.setClient(this.cli);
  nohm.setPrefix('battlemages.test');
  var u = new User;
  u.p('name', 'foo');
  u.p('email', 'foo@bar.com');
  u.save(function(err){
    if(err){
      console.log(err);
    }
    
    var u2 = new User;
    u2.load(u.id, function(err){
      console.log(err);
      console.dir(u2);
    });
    
  });

  
};

exports.tearDown = function(){
  console.log("------------------------");
  console.log("tearing down");
  this.cli.end();
}